import React from 'react'
const {Redirect} = require('dva').router

const AuthRouter=(props)=>{
    const isLogin = window.localStorage.getItem('token')?true:false
    console.log('islogin',isLogin)
    return(
        isLogin?<div>{props.children}</div>:<Redirect to="/login"/>
    )
}

export default AuthRouter